/* 饼状图 */
var chartDom = document.getElementById('pie');
var myChart = echarts.init(chartDom);
var option;

option = {
	title: {
		text: '用户访问来源',
		// subtext: 'Fake Data',
		left: 'center'
	},
	tooltip: {
		trigger: 'item'
	},
	legend: {
		orient: 'vertical',
		left: 'left'
	},
	series: [{
		name: 'Access From',
		type: 'pie',
		radius: '50%',
		data: [{
				value: 735,
				name: '视频广告'
			},
			{
				value: 580,
				name: '搜索引擎'
			},
			{
				value: 484,
				name: '口碑推荐'
			}, {
				value: 2048,
				name: '直接访问'
			},
			{
				value: 300,
				name: '联盟推荐'
			}
		],
		emphasis: {
			itemStyle: {
				shadowBlur: 10,
				shadowOffsetX: 0,
				shadowColor: 'rgba(0, 0, 0, 0.5)'
			}
		}
	}]
};

option && myChart.setOption(option);
